import MathUtil from '@/MathUtil';
import MovementCommon from 'code/Core/Common/MovementCommon';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 骷髅 - 死亡缠绕
 **/
export default class MSK_SiWangChanRao extends AbilityBase {
    static instance: MSK_SiWangChanRao;
    constructor(id: string = 'Mkl0') {
        super(id);
        MSK_SiWangChanRao.instance = this;
        this.init();
        se.onUnitSpellEffect(this.onSpellEffect.bind(this), this.id);
    }
    init() {}
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {
        MovementCommon.LineMissile({
            missile: 'Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl',
            caster: source,
            speed: 450,
            angle: MathUtil.angleBetweenCoords(GetUnitX(source), GetUnitY(source), tarX, tarY),
            distance: 600,
            onHit: this.onReach.bind(this),
        });
    }
    onReach(p: LineMissileConfig, hit: unit) {
        DamageSystemInstance.applyPoisionDamage(hit, p.caster, 450);
    }
    onSpellEffect() {
        this.cast(GetSpellTargetX(), GetSpellTargetY(), GetTriggerUnit(), GetSpellTargetUnit());
    }
}
